<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
     <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="css/basic.css" rel="stylesheet" type="text/css"/>
<title>write blog</title>
<script type="text/javascript">
function show(){
	if("update"=="${param.action}"){
		document.getElementById("change").elements[0].value="${blog.title}";
		document.getElementById("change").action="BlogEdit?action=update";
	}	else
			document.getElementById("change").elements[1].defaultValue  ="";
	}
</script>
</head>
<c:if test="${pass==null }">
<c:redirect url="login.jsp"></c:redirect>
</c:if>
<body style="text-align:center" onload="show()">
<div class="top">
<a href="home.jsp"><button>主页</button></a>
<a href="BlogEdit?action=show"><button>我的博客</button></a>
<a href="writeblog.jsp"><button>上传博客</button></a>
<a href="userinfo.jsp"><button>${pass }</button></a>
<a href="Login?action=leave"><button>退出登录</button></a>
</div>
<h1>上传博客</h1>
<form id="change" action="BlogEdit?action=blog" method="post">
文章标题: <input  type="text" name="title"/><br/>
正文:<br><textarea rows="80" cols="80"  name="note"  id="textfield" style="overflow:scroll; height:500px;font-size: larger;">${blog.content}</textarea><br/>
<input type="submit" name="submit"/>
<input type="hidden" name="id" value="${param.id }">
</form>
<p>${param.msg }</p>
</body>
</html>